
<?php 
header("Content-Type:text/html;charset=utf-8");

include_once '../inc/conn.php';
include_once 'user_alter_class.php';
date_default_timezone_set('PRC');
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>用户修改</title>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.tabfont01 {	
	font-family: "宋体";
	font-size: 9px;
	color: #555555;
	text-decoration: none;
	text-align: center;
}
.font051 {font-family: "宋体";
	font-size: 12px;
	color: #333333;
	text-decoration: none;
	line-height: 20px;
}
.font201 {font-family: "宋体";
	font-size: 12px;
	color: #FF0000;
	text-decoration: none;
}
.button {
	font-family: "宋体";
	font-size: 14px;
	height: 37px;
}
html { overflow-x: auto; overflow-y: auto; border:0;} 
-->
</style>

<link href="../css/css.css" rel="stylesheet" type="text/css" />
<script type="text/JavaScript">

</script>
<link href="../css/style.css" rel="stylesheet" type="text/css" />

</head>

<body>

<?php 
//echo $uid=$_GET['uid'];
if(!empty($_GET['uid'])){
    $uid=$_GET['uid'];
	$getsql="select * from login_user where uid=".$uid;
	$result = $oa->query($getsql); 
	$row=mysql_fetch_array($result);
		$get_id= $row['uid'];
		$get_acc=$row['user_acc'];
		$get_name=$row['username'];
		
?>
<form name="fom" id="fom" method="post" action="">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
 
  <tr>
    <td height="30"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="62" background="../images/nav04.gif">
          
		   <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
		
		  <tr>
			<td width="679" align="left"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="../images/ico07.gif" width="20" height="18" /><font size=2>当前是第<?php echo$_GET['id']; ?>条任务</font>	
			  </td>
		  </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><table id="subtree1" style="DISPLAY: " width="100%" border="0" cellspacing="0" cellpadding="0">

        <tr>
          <td><table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
	         
              <tr>
                <td height="40" class="font42"><table width="100%" border="0" cellpadding="4" cellspacing="1" bgcolor="#464646" class="newfont03">

					                  <tr>
                    <td height="20" colspan="9" align="center" bgcolor="#EEEEEE"class="tablestyle_title"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					用户修改明细 </td>
					
                    </tr>
                  <tr>
				    <td width="15%" height="20" align="right" bgcolor="#FFFFFF">用户ID:</td>
                    <td width="85%" align="left" bgcolor="#FFFFFF"><?php echo $get_id;  ?></td>
                    </tr>
					
					<tr>
				    <td height="20" align="right" bgcolor="#FFFFFF">帐号名:</td>
                    <td bgcolor="#FFFFFF"><?php echo $get_acc; ?></td>
                    </tr>
                  <tr>
				   <td height="20" align="right" bgcolor="#FFFFFF">姓名:</td>
                    <td bgcolor="#FFFFFF"><input type="text" name="user_name" value=" <?php echo $get_name;?>"></td>
                    </tr>
					<tr>
				    <td align="right" bgcolor="#FFFFFF">密码:</td>
                    <td bgcolor="#FFFFFF"><input type="password" name="user_pwd"></td>
                    </tr>
                  <tr>
				    <td align="right" bgcolor="#FFFFFF">用户权限:</td>
                    <td bgcolor="#FFFFFF">
                    <select name="prv_flag" id="select">
                             <option value="0" selected="selected">普通用户</option>
                             <option value="1">部门主管</option>
                             <option value="2">系统管理员</option>
                         </select>
                    </td>
                    </tr>
					<tr>
					<td  colspan=2 bgcolor="#FFFFFF" > 
					<input type="submit" class="button" id ="sub" name="save" value="保存" width="82" height="23"  />
					<input type="button" name="Submit2" value="返回" class="button" onclick="window.history.go(-1);"/></td>
					</tr>
                </table></td>
              </tr>
            </table></td>
        </tr>
      </table>
      <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td height="6"><img src="../images/spacer.gif" width="1" height="1" /></td>
          
          
        </tr>
        
                </table></td>
              </tr>
          </table></td>
        </tr>
      </table></td>
  </tr>
  <tr>
  <td>
   
  </td>
  </tr>
</table>
</form>
<?php

	if(isset($_POST['save'])){
		$user_name = addslashes(trim($_POST["user_name"]));
		$user_pwd = md5(addslashes(trim($_POST["user_pwd"])));
		$prv_flag = addslashes(trim($_POST["prv_flag"]));
		//     echo $user_name ."<br>";
		//     echo  $user_acc ."<br>";
		//     echo $user_pwd ."<br>";
		//     echo $prv_flag ."<br>";
	
		if(!empty($user_name)&&!empty($user_pwd)){
	
			$up=new user_alter();
			$up->update($oa, $uid, $user_name,  $user_pwd, $prv_flag);
	
		}
	  }
	
}	
?>
</body>
</html>

